|
|
|
|
|
|
|
Figure 12.2
This Toolbox contains the
Common controls from all three groups. |
|
|
|
|
|
|
|
|
If you want to use the Common controls in a new project, you will need to add them to the Toolbox. You also need to perform2 these steps whenever you want to use one of the Common controls in an existing project where you have not used them before. After you add them to the Toolbox and save your project, the Common controls appear in the Toolbox automatically the next time the project is loaded. |
|
|
|
|
|
|
|
|
The ImageList:
A Fundamental Common Control |
|
|
|
|
|
|
|
|
The ImageList control is just what it sounds like: a list of images. It is like a picture box or Image control, but instead of storing only a single picture, the ImageList stores a collection of pictures. Also, the ImageList does not contain anything visible at runtime; it is merely a storage area for images. If you want to view one of the images contained in an ImageList, you have to use an additional control. |
|
|
|
|
|
|
|
|
The ImageList is a very important control for you to understand because many of the other Windows Common controls depend on it to display pictures. As a matter of fact, the ImageList control's most common use is to store pictures that another control needs; rarely is it used by itself. |
|
|
|
|
|
|
|
|
Setting Up an ImageList at Designtime |
|
|
|
|
|
|
|
|
The most common way to set up an ImageList control is to add pictures manually at designtime. In this case, the pictures are stored in the form itself. The actual image files do not need to be distributed with the application. |
|
|
|
|
|
|
|
|
|
In this chapter, you will fill image lists with images that are included with Visual Basic. You'll find these graphis in your Visual Basic Graphics directory. You can access these same images (if you chose to install them) by finding the corresponding directory on your PC. Icons are ideal for use with the ImageList because they are small, and you can preview them in the File, Open dialog box.  |
|
|
|
|
|
|
|
|
|
|
Follow these steps to set up an ImageList control at designtime: |
|
|
|
|
|